package com.loongtech.bi.manager.player;

import com.loongtech.bi.entity.player.*;
import com.loongtech.bi.manager.pay.FirstPayUserManager;
import com.loongtech.bi.manager.system.BiPlatformManager;
import com.loongtech.bi.manager.system.GameParamConfigManager;
import com.loongtech.bi.support.CommonGameParam;
import com.loongtech.bi.support.chart.ChartData1;
import com.loongtech.bi.support.chart.ChartFlow;
import com.loongtech.bi.support.chart.ChartSelect;
import com.loongtech.core.jpa.manager.ManagerQueryCacheBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * 玩家分析-留存分析manager
 * 
 * @author marin
 * @date 2015-09-15
 */
@Service
public class AlivePlayerManager extends ManagerQueryCacheBase<Object> {
	private static final long serialVersionUID = 1L;
	
	@Autowired
	private NewUserManager newUserManager;
    @Autowired
    private DauManager dauManager;
    @Autowired
    private NewDeviceManager newDeviceManager;
    @Autowired
    private FirstPayUserManager firstPayUserManager;
	@Autowired
	private LeftManager leftManager;
    @Autowired
    private ActiveUserLeftManager activeUserLeftManager;
    @Autowired
    private DeviceLeftManager deviceLeftManager;
    @Autowired
    private FirstPayUserLeftManager firstPayUserLeftManager;
    @Autowired
    private RoleSchoolLeftManager roleSchoolLeftManager;

    private TypeNewManager<?> getNewManagerByType(String type) {
        if ("1".equals(type)) {
            return newDeviceManager;
        } else if ("2".equals(type)) {
            return newUserManager;
        } else if ("3".equals(type)) {
            return dauManager;
        } else if ("4".equals(type)) {
            return firstPayUserManager;
        }

        return  newDeviceManager;
    }

    private TypeLeftManager<?> getLeftManagerByType(String type) {
        if ("1".equals(type)) {
            return deviceLeftManager;
        } else if ("2".equals(type)) {
            return leftManager;
        } else if ("3".equals(type)) {
            return activeUserLeftManager;
        } else if ("4".equals(type)) {
            return firstPayUserLeftManager;
        }

        return  deviceLeftManager;
    }

    private TypeLeft getLeftByType(String type, String day) {
        if ("2".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDeviceSecondLeft();
            } else if ("2".equals(type)) {
                return new EntitySecondLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUserSecondLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUserSecondLeft();
            }
        } else if ("3".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDeviceThirdLeft();
            } else if ("2".equals(type)) {
                return new EntityThirdLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUserThirdLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUserThirdLeft();
            }
        } else if ("4".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDeviceFourLeft();
            } else if ("2".equals(type)) {
                return new EntityFourLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUserFourLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUserFourLeft();
            }
        } else if ("5".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDeviceFiveLeft();
            } else if ("2".equals(type)) {
                return new EntityFiveLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUserFiveLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUserFiveLeft();
            }
        } else if ("6".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDeviceSixLeft();
            } else if ("2".equals(type)) {
                return new EntitySixLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUserSixLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUserSixLeft();
            }
        } else if ("7".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDeviceSevenLeft();
            } else if ("2".equals(type)) {
                return new EntitySevenLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUserSevenLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUserSevenLeft();
            }
        } else if ("14".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDeviceFourteenLeft();
            } else if ("2".equals(type)) {
                return new EntityFourteenLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUserFourteenLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUserFourteenLeft();
            }
        } else if ("30".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDeviceMonthLeft();
            } else if ("2".equals(type)) {
                return new EntityMonthLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUserMonthLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUserMonthLeft();
            }
        }else if ("60".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDevice60DayLeft();
            } else if ("2".equals(type)) {
                return new EntityUser60DayLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUser60DayLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUser60DayLeft();
            }
        }else if ("90".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDevice90DayLeft();
            } else if ("2".equals(type)) {
                return new EntityUser90DayLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUser90DayLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUser90DayLeft();
            }
        }else if ("120".equals(day)) {
            if ("1".equals(type)) {
                return new EntityDevice120DayLeft();
            } else if ("2".equals(type)) {
                return new EntityUser120DayLeft();
            } else if ("3".equals(type)) {
                return new EntityActiveUser120DayLeft();
            } else if ("4".equals(type)) {
                return new EntityFirstPayUser120DayLeft();
            }
        }

        return  null;
    }

	/**
	 * 得到符合条件的所有数据
	 * @return
	 */
	public List<AlivePlayerData> getAllData(Date dateStart, Date dateEnd, String queryPlatform, String queryChannel, String queryServer, String type) {
		List<AlivePlayerData> result = new ArrayList<>();
		//map
		Map<String,AlivePlayerData> map = new HashMap<>();
		// 新增账号
		List<Object[]> newUserList = getNewManagerByType(type).getNewUserByAllKind(dateStart, dateEnd, queryPlatform, queryChannel, queryServer);

        if (newUserList != null && newUserList.size() > 0) {
            for(Object[] o : newUserList) {
                AlivePlayerData alivePlayerData = new AlivePlayerData();
                alivePlayerData.setDateStr(o[0].toString());
                alivePlayerData.setNewUser(Integer.parseInt(o[1].toString()));
                //map 存入
                map.put(o[0].toString(), alivePlayerData);
            }
        }

		// 次日留存
		List<Object[]> list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "2").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null && o[1] != null) {
				alivePlayerData.setThe2Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerData);
			}
		}
		
		//三日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "3").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null && o[1] != null) {
				alivePlayerData.setThe3Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerData);
			}
		}
		
		// 四日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "4").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null && o[1] != null) {
				alivePlayerData.setThe4Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerData);
			}
		}
		
		// 五日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "5").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null && o[1] != null) {
				alivePlayerData.setThe5Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerData);
			}
		}
		
		// 六日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "6").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null && o[1] != null) {
				alivePlayerData.setThe6Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerData);
			}
		}
				
		// 七日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "7").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null && o[1] != null) {
				alivePlayerData.setThe7Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerData);
			}
		}
		
		// 14日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "14").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null && o[1] != null) {
				alivePlayerData.setThe14Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerData);
			}
		}
		
		// 30日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "30").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null && o[1] != null) {
				alivePlayerData.setThe30Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerData);
			}
		}
		
		// 60日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "60").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			if(alivePlayerData != null && o[1] != null) {
				 alivePlayerData.setThe60Left(Float.parseFloat(o[1].toString()));
				 map.put(o[0].toString(), alivePlayerData);
			}
		}	
		
		// 90日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "90").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			if(alivePlayerData != null && o[1] != null) {
				 alivePlayerData.setThe90Left(Float.parseFloat(o[1].toString()));
				 map.put(o[0].toString(), alivePlayerData);
			}
		}

		// 120日留存
		list = getLeftManagerByType(type).getDayLeftByAllKind(dateStart, dateEnd, getLeftByType(type, "120").getClass(), queryPlatform, queryChannel, queryServer);
		for(Object[] o : list) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			if(alivePlayerData != null && o[1] != null) {
				 alivePlayerData.setThe120Left(Float.parseFloat(o[1].toString()));
				 map.put(o[0].toString(), alivePlayerData);
			}
		}
		
		//遍历存入结果
		for(Object[] o : newUserList) {
			AlivePlayerData alivePlayerData = map.get(o[0].toString());
			
			if(alivePlayerData != null) {
				result.add(alivePlayerData);
			}
		}

		return result;
	}

    public List<RoleSchoolLerfData> getAllRoleSchoolData(Date date, String queryPlatform, String queryChannel, String queryServer) {
        List<RoleSchoolLerfData> result = new ArrayList<>();
        Map<Integer, RoleSchoolLerfData> resultMap = new LinkedHashMap<>();

        // 次日留存
        List<EntityRoleSchoolSecondLeft> list = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchoolSecondLeft.class);
        for (EntityRoleSchoolSecondLeft e : list) {
            int school = e.getSchool();

            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();

                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());

                resultMap.put(school, tmp);
            }

            tmp.setThe2Left(e.getLeftrate());
        }

        //三日留存
        List<EntityRoleSchoolThirdLeft> list3 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchoolThirdLeft.class);
        for (EntityRoleSchoolThirdLeft e : list3) {
            int school = e.getSchool();

            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();

                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());

                resultMap.put(school, tmp);
            }

            tmp.setThe3Left(e.getLeftrate());
        }

        // 四日留存
        List<EntityRoleSchoolFourLeft> list4 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchoolFourLeft.class);
        for (EntityRoleSchoolFourLeft e : list4) {
            int school = e.getSchool();

            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();

                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());

                resultMap.put(school, tmp);
            }

            tmp.setThe4Left(e.getLeftrate());
        }

        // 五日留存
        List<EntityRoleSchoolFiveLeft> list5 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchoolFiveLeft.class);
        for (EntityRoleSchoolFiveLeft e : list5) {
            int school = e.getSchool();

            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();

                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());

                resultMap.put(school, tmp);
            }

            tmp.setThe5Left(e.getLeftrate());
        }

        // 六日留存
        List<EntityRoleSchoolSixLeft> list6 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchoolSixLeft.class);
        for (EntityRoleSchoolSixLeft e : list6) {
            int school = e.getSchool();

            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();

                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());

                resultMap.put(school, tmp);
            }

            tmp.setThe6Left(e.getLeftrate());
        }

        // 七日留存
        List<EntityRoleSchoolSevenLeft> list7 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchoolSevenLeft.class);
        for (EntityRoleSchoolSevenLeft e : list7) {
            int school = e.getSchool();

            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();

                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());

                resultMap.put(school, tmp);
            }

            tmp.setThe7Left(e.getLeftrate());
        }

        // 14日留存
        List<EntityRoleSchoolFourteenLeft> list14 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchoolFourteenLeft.class);
        for (EntityRoleSchoolFourteenLeft e : list14) {
            int school = e.getSchool();

            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();

                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());

                resultMap.put(school, tmp);
            }

            tmp.setThe14Left(e.getLeftrate());
        }

        // 30日留存
        List<EntityRoleSchoolMonthLeft> list30 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchoolMonthLeft.class);
        for (EntityRoleSchoolMonthLeft e : list30) {
            int school = e.getSchool();
            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();
                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());
                resultMap.put(school, tmp);
            }

            tmp.setThe30Left(e.getLeftrate());
        }
 
        // 60日留存
        List<EntityRoleSchool60DayLeft> list60 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchool60DayLeft.class);
        for (EntityRoleSchool60DayLeft e : list60) {
            int school = e.getSchool();
            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();
                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());
                resultMap.put(school, tmp);
            }

            tmp.setThe60Left(e.getLeftrate());
        }
        
        // 90日留存
        List<EntityRoleSchool90DayLeft> list90 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchool90DayLeft.class);
        for (EntityRoleSchool90DayLeft e : list90) {
            int school = e.getSchool();
            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();
                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());
                resultMap.put(school, tmp);
            }

            tmp.setThe90Left(e.getLeftrate());
        }
  
        // 120日留存
        List<EntityRoleSchool120DayLeft> list120 = roleSchoolLeftManager.getRoleSchoolLeftByDate(date, queryPlatform, queryChannel, queryServer, EntityRoleSchool120DayLeft.class);
        for (EntityRoleSchool120DayLeft e : list120) {
            int school = e.getSchool();
            RoleSchoolLerfData tmp = resultMap.get(school);
            if (tmp == null) {
                tmp = new RoleSchoolLerfData();
                tmp.setPlatformId(queryPlatform);
                tmp.setChannelId(queryChannel);
                tmp.setServerId(queryServer);
                tmp.setSchool(school);
                tmp.setNewRole(e.getRolecreate());
                resultMap.put(school, tmp);
            }

            tmp.setThe120Left(e.getLeftrate());
        }

        result.addAll(resultMap.values());
        return result;
    }

	/**
	 * 平台留存对比
	 * @param dateStart
	 * @param dateEnd
	 * @return
	 */
	public List<AlivePlayerPlatformData> getLeftByPlatformGroupByPlatform(Date dateStart, Date dateEnd) {
		List<AlivePlayerPlatformData> result = new ArrayList<AlivePlayerPlatformData>();
		//map
		Map<String,AlivePlayerPlatformData> map = new HashMap<String,AlivePlayerPlatformData>();
	
		//次日留存
		List<Object[]> secondLeftList = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntitySecondLeft.class);
		for(Object[] o : secondLeftList) {
			AlivePlayerPlatformData alivePlayerPlatformData = new AlivePlayerPlatformData();
			alivePlayerPlatformData.setPlatformId(o[0].toString());
			alivePlayerPlatformData.setThe2Left(Float.parseFloat(o[1].toString()));
			//map 存入
			map.put(o[0].toString(), alivePlayerPlatformData);
		}
		
		//三日留存
		List <Object[]> list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntityThirdLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe3Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//四日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntityFourLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe4Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//五日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntityFiveLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe5Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//六日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntitySixLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe6Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//七日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntitySevenLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe7Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//14日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntityFourteenLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe14Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//30日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntityMonthLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe30Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//60日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntityUser60DayLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe60Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//90日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntityUser90DayLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe90Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//120日留存
		list = leftManager.getLeftByPlatformGroupByPlatform(dateStart, dateEnd, EntityUser120DayLeft.class);
		for(Object[] o : list) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
			
			if(alivePlayerPlatformData != null) {
				alivePlayerPlatformData.setThe120Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerPlatformData);
			}
		}
		
		//遍历存入结果
		for(Object[] o : secondLeftList) {
			AlivePlayerPlatformData alivePlayerPlatformData = map.get(o[0].toString());
				
			if(alivePlayerPlatformData != null) {
				result.add(alivePlayerPlatformData);
			}
		}
		
		return result;
	}
	
	/**
	 * 平台留存对比
	 * @param dateStart
	 * @param dateEnd
	 * @return
	 */
	public List<AlivePlayerChannelData> getLeftByChannelGroupByChannel(Date dateStart, Date dateEnd) {
		List<AlivePlayerChannelData> result = new ArrayList<AlivePlayerChannelData>();
		//map
		Map<String,AlivePlayerChannelData> map = new HashMap<String,AlivePlayerChannelData>();
	
	
		//次日留存
		List<Object[]> secondLeftList = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntitySecondLeft.class);
		
		for(Object[] o : secondLeftList) {
			AlivePlayerChannelData alivePlayerChannelData = new AlivePlayerChannelData();
			alivePlayerChannelData.setChannelId(o[0].toString());
			alivePlayerChannelData.setThe2Left(Float.parseFloat(o[1].toString()));
			//map 存入
			map.put(o[0].toString(), alivePlayerChannelData);
		}
		
		//三日留存
		List <Object[]> list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntityThirdLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe3Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//4日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntityFourLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe4Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//5日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntityFiveLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe5Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//6日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntitySixLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe6Left(Float.parseFloat(o[1].toString()));
				//map 存入
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//七日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntitySevenLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe7Left(Float.parseFloat(o[1].toString()));
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//14日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntityFourteenLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe14Left(Float.parseFloat(o[1].toString()));
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//30日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntityMonthLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe30Left(Float.parseFloat(o[1].toString()));
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//60日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntityUser60DayLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe60Left(Float.parseFloat(o[1].toString()));
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//90日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntityUser90DayLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe90Left(Float.parseFloat(o[1].toString()));
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//120日留存
		list = leftManager.getLeftByChannelGroupByChannel(dateStart, dateEnd, EntityUser120DayLeft.class);
		for(Object[] o : list) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			
			if(alivePlayerChannelData != null) {
				alivePlayerChannelData.setThe120Left(Float.parseFloat(o[1].toString()));
				map.put(o[0].toString(), alivePlayerChannelData);
			}
		}
		
		//遍历存入结果
		for(Object[] o : secondLeftList) {
			AlivePlayerChannelData alivePlayerChannelData = map.get(o[0].toString());
			if(alivePlayerChannelData != null) {
				result.add(alivePlayerChannelData);
			}
		}
		
		return result;
	}

	public List<RoleSchoolLeftChartData> getRoleSchoolleftChartData(List<RoleSchoolLerfData> dataSchoolList) {
        List<AlivePlayerManager.RoleSchoolLeftChartData> list = new ArrayList<>();

        for (RoleSchoolLerfData ar : dataSchoolList) {
            RoleSchoolLeftChartData r2 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r3 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r4 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r5 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r6 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r7 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r14 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r30 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r60 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r90 = new RoleSchoolLeftChartData();
            RoleSchoolLeftChartData r120 = new RoleSchoolLeftChartData();

            r2.setSchool(ar.getSchool());
            r2.setLefttype(2);
            r2.setLeft(ar.getThe2Left());
            r3.setSchool(ar.getSchool());
            r3.setLefttype(3);
            r3.setLeft(ar.getThe3Left());
            r4.setSchool(ar.getSchool());
            r4.setLefttype(4);
            r4.setLeft(ar.getThe4Left());
            r5.setSchool(ar.getSchool());
            r5.setLefttype(5);
            r5.setLeft(ar.getThe5Left());
            r6.setSchool(ar.getSchool());
            r6.setLefttype(6);
            r6.setLeft(ar.getThe6Left());
            r7.setSchool(ar.getSchool());
            r7.setLefttype(7);
            r7.setLeft(ar.getThe7Left());
            r14.setSchool(ar.getSchool());
            r14.setLefttype(14);
            r14.setLeft(ar.getThe14Left());
            r30.setSchool(ar.getSchool());
            r30.setLefttype(30);
            r30.setLeft(ar.getThe30Left());
            r60.setSchool(ar.getSchool());
            r60.setLefttype(60);
            r60.setLeft(ar.getThe60Left());
            r90.setSchool(ar.getSchool());
            r90.setLefttype(90);
            r90.setLeft(ar.getThe90Left());
            r120.setSchool(ar.getSchool());
            r120.setLefttype(120);
            r120.setLeft(ar.getThe120Left());

            list.add(r2);
            list.add(r3);
            list.add(r4);
            list.add(r5);
            list.add(r6);
            list.add(r7);
            list.add(r14);
            list.add(r30);
            list.add(r60);
            list.add(r90);
            list.add(r120);
        }

        return list;
    }

    public class RoleSchoolLeftChartData {
        private int lefttype;
        @ChartFlow(name="留存")
        private String lefttypeStr;
	    private int school;
        private String schoolName;
        @ChartSelect(name = "留存率", key = 1)
        @ChartData1(name = "留存率", key = 1, multiByFiled = "schoolName")
        private float left;

        public int getLefttype() {
            return lefttype;
        }

        public void setLefttype(int lefttype) {
            this.lefttype = lefttype;
            this.lefttypeStr = lefttype + "日留存";
        }

        public String getLefttypeStr() {
            return lefttypeStr;
        }

        public void setLefttypeStr(String lefttypeStr) {
            this.lefttypeStr = lefttypeStr;
        }

        public int getSchool() {
            return school;
        }

        public void setSchool(int school) {
            this.school = school;
            this.schoolName = GameParamConfigManager.getItemsRevise(CommonGameParam.SCHOOL).get(String.valueOf(school)) == null ? school + "" : GameParamConfigManager.getItemsRevise(CommonGameParam.SCHOOL).get(String.valueOf(school));
        }

        public String getSchoolName() {
            return schoolName;
        }


        public void setSchoolName(String schoolName) {
            this.schoolName = schoolName;
        }

        public float getLeft() {
            return left;
        }

        public void setLeft(float left) {
            this.left = left;
        }
    }

    public class RoleSchoolLerfData {
        private String platformId;
        private String channelId;
        private String serverId;
        private int school;
        private String schoolName;
        private int newRole; // 新增
        private float the2Left; // 新增帐号次日留存率
        private float the3Left; // 新增帐号3日留存率
        private float the4Left; // 新增帐号4日留存率
        private float the5Left; // 新增帐号5日留存率
        private float the6Left; // 新增帐号6日留存率
        private float the7Left; // 新增帐号7日留存率
        private float the14Left; // 新增帐号14日留存率
        private float the30Left; // 新增帐号30日留存率
        private float the60Left; // 新增帐号60日留存率
		private float the90Left; // 新增帐号90日留存率
		private float the120Left; // 新增帐号120日留存率

        public String getPlatformId() {
            return platformId;
        }

        public void setPlatformId(String platformId) {
            this.platformId = platformId;
        }

        public String getChannelId() {
            return channelId;
        }

        public void setChannelId(String channelId) {
            this.channelId = channelId;
        }

        public String getServerId() {
            return serverId;
        }

        public void setServerId(String serverId) {
            this.serverId = serverId;
        }

        public float getThe2Left() {
            return the2Left;
        }

        public void setThe2Left(float the2Left) {
            this.the2Left = the2Left;
        }

        public float getThe3Left() {
            return the3Left;
        }

        public void setThe3Left(float the3Left) {
            this.the3Left = the3Left;
        }

        public float getThe4Left() {
            return the4Left;
        }

        public void setThe4Left(float the4Left) {
            this.the4Left = the4Left;
        }

        public float getThe5Left() {
            return the5Left;
        }

        public void setThe5Left(float the5Left) {
            this.the5Left = the5Left;
        }

        public float getThe6Left() {
            return the6Left;
        }

        public void setThe6Left(float the6Left) {
            this.the6Left = the6Left;
        }

        public float getThe7Left() {
            return the7Left;
        }

        public void setThe7Left(float the7Left) {
            this.the7Left = the7Left;
        }

        public float getThe14Left() {
            return the14Left;
        }

        public void setThe14Left(float the14Left) {
            this.the14Left = the14Left;
        }

        public float getThe30Left() {
            return the30Left;
        }

        public void setThe30Left(float the30Left) {
            this.the30Left = the30Left;
        }

        public int getSchool() {
            return school;
        }

        public void setSchool(int school) {
            this.school = school;
            this.schoolName = GameParamConfigManager.getItemsRevise(CommonGameParam.SCHOOL).get(String.valueOf(school)) == null ? school + "" : GameParamConfigManager.getItemsRevise(CommonGameParam.SCHOOL).get(String.valueOf(school));
        }

        public String getSchoolName() {
            return schoolName;
        }

        public void setSchoolName(String schoolName) {
            this.schoolName = schoolName;
        }

        public int getNewRole() {
            return newRole;
        }

        public void setNewRole(int newRole) {
            this.newRole = newRole;
        }

		public float getThe60Left() {
			return the60Left;
		}

		public void setThe60Left(float the60Left) {
			this.the60Left = the60Left;
		}

		public float getThe90Left() {
			return the90Left;
		}

		public void setThe90Left(float the90Left) {
			this.the90Left = the90Left;
		}

		public float getThe120Left() {
			return the120Left;
		}

		public void setThe120Left(float the120Left) {
			this.the120Left = the120Left;
		}
    }

	// TODO 真实情况应该是数据库实体类或者抽象出的表现类。这里也做前端柱状图的生成类
	public class AlivePlayerData {
		private String platformId;
		private String channelId;
		private String serverId;
		@ChartFlow(name="日期")
		private String dateStr; // 日期

		private int newUser; // 新增帐号数
		@ChartSelect(name = "留存率", key = 1)
		@ChartData1(name = "次日留存率", key = 1)
		private float the2Left; // 新增帐号次日留存率
		@ChartData1(name = "3日留存率", key = 1)
		private float the3Left; // 新增帐号3日留存率
		private float the4Left; // 新增帐号3日留存率
		private float the5Left; // 新增帐号3日留存率
		private float the6Left; // 新增帐号3日留存率
		@ChartData1(name = "7日留存率", key = 1)
		private float the7Left; // 新增帐号7日留存率
		private float the14Left; // 新增帐号14日留存率
		private float the30Left; // 新增帐号30日留存率
		private float the60Left; // 新增帐号60日留存率
		private float the90Left; // 新增帐号90日留存率
		private float the120Left; // 新增帐号120日留存率

		public String getPlatformId() {
			return platformId;
		}

		public void setPlatformId(String platformId) {
			this.platformId = platformId;
		}

		public String getChannelId() {
			return channelId;
		}

		public void setChannelId(String channelId) {
			this.channelId = channelId;
		}

		public String getServerId() {
			return serverId;
		}

		public void setServerId(String serverId) {
			this.serverId = serverId;
		}

		public String getDateStr() {
			return dateStr;
		}

		public void setDateStr(String dateStr) {
			this.dateStr = dateStr;
		}

		public int getNewUser() {
			return newUser;
		}

		public void setNewUser(int newUser) {
			this.newUser = newUser;
		}

		public float getThe2Left() {
			return the2Left;
		}

		public void setThe2Left(float the2Left) {
			this.the2Left = the2Left;
		}

		public float getThe3Left() {
			return the3Left;
		}

		public void setThe3Left(float the3Left) {
			this.the3Left = the3Left;
		}

		public float getThe4Left() {
			return the4Left;
		}

		public void setThe4Left(float the4Left) {
			this.the4Left = the4Left;
		}

		public float getThe5Left() {
			return the5Left;
		}

		public void setThe5Left(float the5Left) {
			this.the5Left = the5Left;
		}

		public float getThe6Left() {
			return the6Left;
		}

		public void setThe6Left(float the6Left) {
			this.the6Left = the6Left;
		}

		public float getThe7Left() {
			return the7Left;
		}

		public void setThe7Left(float the7Left) {
			this.the7Left = the7Left;
		}

		public float getThe14Left() {
			return the14Left;
		}

		public void setThe14Left(float the14Left) {
			this.the14Left = the14Left;
		}

		public float getThe30Left() {
			return the30Left;
		}

		public void setThe30Left(float the30Left) {
			this.the30Left = the30Left;
		}

		public float getThe60Left() {
			return the60Left;
		}

		public void setThe60Left(float the60Left) {
			this.the60Left = the60Left;
		}

		public float getThe90Left() {
			return the90Left;
		}

		public void setThe90Left(float the90Left) {
			this.the90Left = the90Left;
		}

		public float getThe120Left() {
			return the120Left;
		}

		public void setThe120Left(float the120Left) {
			this.the120Left = the120Left;
		}
	}
	
	public class AlivePlayerPlatformData {
		private String platformId;
		@ChartFlow(name="平台")
		private String platformName;
		private String channelId;
		private String serverId;
		private String dateStr; // 日期
		private int newUser; // 新增帐号数
		@ChartSelect(name = "次日留存率", key = 1)
		@ChartData1(name = "次日留存率", key = 1)
		private float the2Left; // 新增帐号次日留存率
		@ChartSelect(name = "3日留存率", key = 2)
		@ChartData1(name = "3日留存率", key = 2)
		private float the3Left; // 新增帐号3日留存率
		private float the4Left; // 新增帐号3日留存率
		private float the5Left; // 新增帐号3日留存率
		private float the6Left; // 新增帐号3日留存率
		@ChartSelect(name = "7日留存率", key = 3)
		@ChartData1(name = "7日留存率", key = 3)
		private float the7Left; // 新增帐号7日留存率
		private float the14Left; // 新增帐号14日留存率
		private float the30Left; // 新增帐号30日留存率
		private float the60Left; // 新增帐号60日留存率
		private float the90Left; // 新增帐号90日留存率
		private float the120Left; // 新增帐号120日留存率

		public String getPlatformId() {
			return platformId;
		}

		public void setPlatformId(String platformId) {
			this.platformId = platformId;
			this.platformName = BiPlatformManager.getPlatformNameById(platformId);
		}

		public String getChannelId() {
			return channelId;
		}

		public void setChannelId(String channelId) {
			this.channelId = channelId;
		}

		public String getServerId() {
			return serverId;
		}

		public void setServerId(String serverId) {
			this.serverId = serverId;
		}

		public String getDateStr() {
			return dateStr;
		}

		public void setDateStr(String dateStr) {
			this.dateStr = dateStr;
		}

		public int getNewUser() {
			return newUser;
		}

		public void setNewUser(int newUser) {
			this.newUser = newUser;
		}

		public float getThe2Left() {
			return the2Left;
		}

		public void setThe2Left(float the2Left) {
			this.the2Left = the2Left;
		}

		public float getThe3Left() {
			return the3Left;
		}

		public void setThe3Left(float the3Left) {
			this.the3Left = the3Left;
		}

		public float getThe4Left() {
			return the4Left;
		}

		public void setThe4Left(float the4Left) {
			this.the4Left = the4Left;
		}

		public float getThe5Left() {
			return the5Left;
		}

		public void setThe5Left(float the5Left) {
			this.the5Left = the5Left;
		}

		public float getThe6Left() {
			return the6Left;
		}

		public void setThe6Left(float the6Left) {
			this.the6Left = the6Left;
		}

		public float getThe7Left() {
			return the7Left;
		}

		public void setThe7Left(float the7Left) {
			this.the7Left = the7Left;
		}

		public float getThe14Left() {
			return the14Left;
		}

		public void setThe14Left(float the14Left) {
			this.the14Left = the14Left;
		}

		public float getThe30Left() {
			return the30Left;
		}

		public void setThe30Left(float the30Left) {
			this.the30Left = the30Left;
		}

		public String getPlatformName() {
			return platformName;
		}

		public void setPlatformName(String platformName) {
			this.platformName = platformName;
		}

		public float getThe60Left() {
			return the60Left;
		}

		public void setThe60Left(float the60Left) {
			this.the60Left = the60Left;
		}

		public float getThe90Left() {
			return the90Left;
		}

		public void setThe90Left(float the90Left) {
			this.the90Left = the90Left;
		}

		public float getThe120Left() {
			return the120Left;
		}

		public void setThe120Left(float the120Left) {
			this.the120Left = the120Left;
		}
	}
	
	public class AlivePlayerChannelData {
		private String platformId;
		private String channelId;
		@ChartFlow(name="渠道")
		private String channelName;
		private String serverId;
		private String dateStr; // 日期
		private int newUser; // 新增帐号数
		@ChartSelect(name = "次日留存率", key = 1)
		@ChartData1(name = "次日留存率", key = 1)
		private float the2Left; // 新增帐号次日留存率
		@ChartSelect(name = "3日留存率", key = 2)
		@ChartData1(name = "3日留存率", key = 2)
		private float the3Left; // 新增帐号3日留存率
		private float the4Left; // 新增帐号3日留存率
		private float the5Left; // 新增帐号3日留存率
		private float the6Left; // 新增帐号3日留存率
		@ChartSelect(name = "7日留存率", key = 3)
		@ChartData1(name = "7日留存率", key = 3)
		private float the7Left; // 新增帐号7日留存率
		private float the14Left; // 新增帐号14日留存率
		private float the30Left; // 新增帐号30日留存率
		private float the60Left; // 新增帐号60日留存率
		private float the90Left; // 新增帐号90日留存率
		private float the120Left; // 新增帐号120日留存率

		public String getPlatformId() {
			return platformId;
		}

		public void setPlatformId(String platformId) {
			this.platformId = platformId;
		}

		public String getChannelId() {
			return channelId;
		}

		public void setChannelId(String channelId) {
			this.channelId = channelId;
			this.channelName = BiPlatformManager.getChannelNameById(channelId);
		}

		public String getServerId() {
			return serverId;
		}

		public void setServerId(String serverId) {
			this.serverId = serverId;
		}

		public String getDateStr() {
			return dateStr;
		}

		public void setDateStr(String dateStr) {
			this.dateStr = dateStr;
		}

		public int getNewUser() {
			return newUser;
		}

		public void setNewUser(int newUser) {
			this.newUser = newUser;
		}

		public float getThe2Left() {
			return the2Left;
		}

		public void setThe2Left(float the2Left) {
			this.the2Left = the2Left;
		}

		public float getThe3Left() {
			return the3Left;
		}

		public void setThe3Left(float the3Left) {
			this.the3Left = the3Left;
		}

		public float getThe4Left() {
			return the4Left;
		}

		public void setThe4Left(float the4Left) {
			this.the4Left = the4Left;
		}

		public float getThe5Left() {
			return the5Left;
		}

		public void setThe5Left(float the5Left) {
			this.the5Left = the5Left;
		}

		public float getThe6Left() {
			return the6Left;
		}

		public void setThe6Left(float the6Left) {
			this.the6Left = the6Left;
		}

		public float getThe7Left() {
			return the7Left;
		}

		public void setThe7Left(float the7Left) {
			this.the7Left = the7Left;
		}

		public float getThe14Left() {
			return the14Left;
		}

		public void setThe14Left(float the14Left) {
			this.the14Left = the14Left;
		}

		public float getThe30Left() {
			return the30Left;
		}

		public void setThe30Left(float the30Left) {
			this.the30Left = the30Left;
		}

		public String getChannelName() {
			return channelName;
		}

		public void setChannelName(String channelName) {
			this.channelName = channelName;
		}

		public float getThe60Left() {
			return the60Left;
		}

		public void setThe60Left(float the60Left) {
			this.the60Left = the60Left;
		}

		public float getThe90Left() {
			return the90Left;
		}

		public void setThe90Left(float the90Left) {
			this.the90Left = the90Left;
		}

		public float getThe120Left() {
			return the120Left;
		}

		public void setThe120Left(float the120Left) {
			this.the120Left = the120Left;
		}
	}
}